@PACKAGE_INIT@

include(CMakeFindDependencyMacro)

# Find dependencies
find_dependency(fmt)
find_dependency(nlohmann_json)
find_dependency(OpenSSL)
find_dependency(CURL)
find_dependency(ZLIB)
find_dependency(Threads)

# Include targets
include("${CMAKE_CURRENT_LIST_DIR}/mcp-cpp-targets.cmake")

# Check for optional dependencies
find_package(cppcoro QUIET)

# Set variables
set(MCP_CPP_VERSION @PROJECT_VERSION@)
set(MCP_CPP_INCLUDE_DIRS "@PACKAGE_CMAKE_INSTALL_INCLUDEDIR@")
set(MCP_CPP_LIBRARIES mcp-cpp)

# Compatibility functions
function(mcp_cpp_setup)
    # Setup function for backward compatibility
endfunction()

# Check version
function(mcp_cpp_check_version MIN_VERSION)
    if(@PROJECT_VERSION@ VERSION_LESS MIN_VERSION)
        message(FATAL_ERROR "MCP C++ SDK version @PROJECT_VERSION@ is less than required ${MIN_VERSION}")
    endif()
endfunction()

# Print setup information
message(STATUS "Found MCP C++ SDK @PROJECT_VERSION@")
message(STATUS "  Include dirs: ${MCP_CPP_INCLUDE_DIRS}")
message(STATUS "  Libraries: ${MCP_CPP_LIBRARIES}")
message(STATUS "  C++ standard: @CMAKE_CXX_STANDARD@")